<?php get_backend_header(array(
	'jquery/validate/jquery.validate.js',
	'student.js',
), array(
	'jquery/ui.jqgrid.css'
)); ?>

<h2 class="title"><?php echo ($user_id) ?  'Edit' : 'Add'; ?> Student</h2>

<form id="user_form" name="user_form" class="form">
	<input type="hidden" id="user_id" name="user_id" value="<?php echo $user_id; ?>" />

            <div class="unit">
                
                
                <div class="line">
                        <label for="" class="">User no:</label>
                        <div class="field" style="height:auto">
                            <input type="text" name="user_no" id="user_no" value="<?php echo $user_no; ?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Course:</label>
                        <div class="field" style="height:auto">
                        <select name="course" id="course">
                                <option value="">- Select -</option>
                                <?php echo html_options($courses_op, 'course_id', NULL, 'course_label', $course, FALSE) ?>
                        </select>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">First name:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="fname" id="fname" value="<?php echo $fname; ?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Middle name:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="mname" id="mname" value="<?php echo $mname; ?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Last name:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="lname" id="lname" value="<?php echo $lname; ?>" />
                        </div>
                </div>

                <div class="line">
                        <label for="" class="bold">E-mail:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="email" id="email" value="<?php echo $email; ?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Contact no:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="contact_no" id="contact_no" value="<?php echo $contact_no; ?>"/>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Contact person:</label>
                        <div class="field" style="height:auto">
                          <input type="text" name="contact_person" id="contact_person" value="<?php echo $contact_person; ?>" />
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Address:</label>
                        <div class="field" style="height:auto; width:auto;">
                            <textarea id="address" name="address"><?php echo $address;?></textarea>
                        </div>
                </div>
                
                <div class="line">
                        <label for="" class="">Status:</label>
                        <div class="field" style="height:auto; width:auto;">
                            <input type="radio" name="status" value="Active" <?php if($status == 'Active') echo 'checked = "checked"' ;?>>Active<br />
                            <input type="radio" name="status" value="Inactive" <?php if($status == 'Inactive') echo 'checked = "checked"' ;?>>Inactive<br />
                        </div>
                </div>


            </div>


        <div class ="clear"></div>

	<div class="buttons">
		<button id="save" name="save">Save</button>
		<a href="<?php echo site_url('student/list_records'); ?>" id="cancel" name="cancel">Cancel</a>
	</div>
</form>


<script type="text/javascript">
        studentRules();


	$('#cancel').button({
		icons: {primary: 'ui-icon-arrowreturn-1-w'}
	});	
	
	$('#save').button({
		icons: {primary: 'ui-icon-disk'}
	}).click(function(e) {
		$(this).removeClass('ui-state-focus');
		$('#user_form').submit();
		e.preventDefault();
	});	

</script>

<?php get_backend_footer(); ?>
